<body class="gray-bg">
<div class="wrapper wrapper-content animated ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{$page_title}</h5>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <form id="pagerForm" method="post" class="form-inline searchForm">
                            <div class="col-sm-12">
                                <div class="input-group">
                                    <div class="suggest-search-box">
                                        <div class="input-group colour-suggest">
                                            <input type="hidden" name="colour_id" value="{$colour_id|default='0'}">
                                            <input type="text" name="colour_name" value="{$colour_name|default=''}" class="form-control suggest-input"  placeholder="请输入颜色名称"
                                                   data-url="{:url('Comm/suggest_search',array('datatype'=>'colour'))}"
                                                   searchFields="keywords"
                                                   target-group="colour-suggest" target-name='{"colour_id":"id","colour_name":"name"}'>
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="input-group">
                                    <div class="suggest-search-box">
                                        <div class="input-group quality-suggest">
                                            <input type="hidden" name="quality_id" value="{$quality_id|default='0'}">
                                            <input type="text" name="quality_name" value="{$quality_name|default=''}" class="form-control suggest-input"  placeholder="请输入材质名称"
                                                   data-url="{:url('Comm/suggest_search',array('datatype'=>'quality'))}"
                                                   searchFields="keywords"
                                                   target-group="quality-suggest" target-name='{"quality_id":"id","quality_name":"name"}'>
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="input-group">
                                    <div class="suggest-search-box">
                                        <div class="input-group shelves-suggest">
                                            <input type="hidden" name="shelves_id" value="{$shelves_id|default='0'}">
                                            <input type="text" name="shelves_name" value="{$shelves_name|default=''}" class="form-control suggest-input"  placeholder="请输入货架名称"
                                                   data-url="{:url('Comm/suggest_search',array('datatype'=>'shelves'))}"
                                                   searchFields="keywords"
                                                   target-group="shelves-suggest" target-name='{"shelves_id":"id","shelves_name":"name"}'>
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="input-group">
                                    <div class="suggest-search-box">
                                        <div class="input-group shelves-cell-suggest">
                                            <input type="hidden" name="shelves_cell_id" value="{$shelves_cell_id|default='0'}">
                                            <input type="text" name="shelves_cell_code" value="{$shelves_cell_code|default=''}" class="form-control suggest-input"  placeholder="请选择格子名称"
                                                   data-url="{:url('Comm/suggest_search',array('datatype'=>'shelves_cell'))}"
                                                   searchFields="keywords"
                                                   source-group="shelves-suggest" source-name='{"shelves_id":"货架"}'
                                                   target-group="shelves-cell-suggest" target-name='{"shelves_cell_id":"id","shelves_cell_code":"name"}'>
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="input-group w100"><input type="text" name="leng" placeholder="最小长" class="form-control"></div>
                                <div class="input-group w100"><input type="text" name="width" placeholder="最小宽" class="form-control"></div>
                                <div class="input-group w100"><input type="text" name="area" placeholder="最小面积" class="form-control"></div>
                                <div class="input-group">
                                    <input type="text" name="keywords" placeholder="输入关键字搜索" class="form-control">
                                </div>
                                <div class="input-group">
                                    <span class="input-group-btn"><button type="button" class="btn btn-primary ajaxSearchForm"><i class="fa fa-search"></i> 搜索</button></span>
                                </div>
                                <div class="input-group">
                                    <span class="input-group-btn"> <button type="button" class="btn btn-warning ajaxSearchForm resetForm"><i class="fa fa-recycle"></i> 重置</button></span>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="ibox">
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-10">
                            <lqf_link><a class="btn btn-info ajax-open" data-url="{:url('MaterialBorad/add')}"><i class="fa fa-plus"></i> 添加</a></lqf_link>
                            <lqf_link><a class="btn btn-warning ajax-get-more" data-url="{:url('MaterialBorad/lock')}"><i class="fa fa-lock"></i> 锁定</a></lqf_link>
                            <lqf_link><a class="btn btn-primary ajax-get-more" data-url="{:url('MaterialBorad/used')}"><i class="fa fa-paste"></i> 使用</a></lqf_link>
                            <lqf_link><a class="btn btn-danger ajax-get-more" data-url="{:url('MaterialBorad/discard')}"><i class="fa fa-remove"></i> 报废</a></lqf_link>
                        </div>
                        <div class="col-sm-2 text-right">
                            <a href="javascript:void(0);" class="btn btn-default btn-outline btn-field-set" data-id="{$page_title|default=''}"> <i class="fa fa-columns"></i> 列</a>
                        </div>
                    </div>
                </div>
                <div class="ibox-content table-responsive">
                    <table class="table table-hover sorttable ajax-list-table"
                           data-url="{:url('MaterialBorad/show_json')}" width="100%">
                        <thead>
                        <tr>
                            <th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
                            <th width="100"><span>板材名称</span></th>
                            <th width="100"><span>型号</span></th>
                            <th width="100"><span>颜色</span></th>
                            <th width="100"><span>材质</span></th>
                            <th width="100"><span>货架</span></th>
                            <th width="100"><span>格子</span></th>
                            <th width="100"  orderField="leng" class="sort-filed"><span>长度</span></th>
                            <th width="100"  orderField="width" class="sort-filed"><span>宽度</span></th>
                            <th width="100"  orderField="area" class="sort-filed"><span>面积</span></th>
                            <th width="80" class="text-center"><span>缩略图</span></th>
                            <th width="80" class="text-center">当前状态</th>
                            <th width="80" class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        </tbody>
                        <tfoot class="ibox-content">
                        <tr>
                            <td colspan="5" align="center"></td>
                        </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script id="tableListTpl" type="text/html">
    <% for(var i=0;i
    <data.length;i++) {
    visible='';
    if(data[i]['visible']=='1') visible='checked';
    %>
    <tr>
        <td><input name="id" class="checkboxCtrlId" value="<%=data[i]['id']%>" type="checkbox"></td>
        <td><%=data[i]['name']%></td>
        <td><%=data[i]['model_code']%></td>
        <td><%=data[i]['colour_name']%></td>
        <td><%=data[i]['quality_name']%></td>
        <td><%=data[i]['shelves_name']%></td>
        <td><%=data[i]['shelves_cell_code']%></td>
        <td><%=data[i]['leng']%></td>
        <td><%=data[i]['width']%></td>
        <td><%=data[i]['area']%></td>
        <td class="text-center">
            <a class="fancybox" href="<%=data[i]['litpic']%>" title="图片1">
                <img src="<%=data[i]['litpic']%>" width="60">
            </a>
        </td>
        <td class="text-center"><%:=data[i]['use_status_arr']['html']%></td>
        <td class="text-center">
            <lqf_link><a class="ajax-open" data-url="{:url('MaterialBorad/edit')}"
                         data-ids="{'id':'<%=data[i]['id']%>'}" data-title="修改">修改</a></lqf_link>
            <lqf_link><a class="ajax-del confirm" data-url="{:url('MaterialBorad/del')}"
                         data-ids="{'id':'<%=data[i]['id']%>'}">删除</a></lqf_link>
        </td>
    </tr>
    <% } %>
</script>
<script type="text/javascript">
    $(document).ready(function () {
        turnPage(1);//页面加载时初始化分页
    });
</script>
<!-- Fancy box -->
<script src="__STATIC__/module/admin/js/plugins/fancybox/jquery.fancybox.js"></script>
<link href="__STATIC__/module/admin/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
<script>
    $(document).ready(function () {
        $('.fancybox').fancybox({
            openEffect: 'none',
            closeEffect: 'none'
        });
    });
</script>